$OpenBSD: patch-Source_kwsys_SystemTools_cxx,v 1.20 2016/11/28 09:15:13 dcoppa Exp $

Don't spam systrace by attempting to create dirs which already exist

--- Source/kwsys/SystemTools.cxx.orig	Fri Nov 11 15:37:14 2016
+++ Source/kwsys/SystemTools.cxx	Fri Nov 25 22:31:45 2016
@@ -304,11 +304,13 @@ inline void Realpath(const std::string& path,
 }
 #else
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 inline int Mkdir(const std::string& dir)
 {
-  return mkdir(dir.c_str(), 00777);
+  struct stat sb;
+  return stat(dir.c_str(), &sb) && mkdir(dir.c_str(), 00777);
 }
 inline int Rmdir(const std::string& dir)
 {
